package com.yyx.app1.Question_function.UI;

import android.app.Activity;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ListView;

import com.yyx.app1.Question_function.Control.petinfo.PetInfoListViewAdapter;
import com.yyx.app1.R;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;

/**
 * Created by yuexing on 2015/10/21.
 */
@EActivity(R.layout.activity_petinfo)
public class PetInfo_Activity extends Activity {
    private PetInfoListViewAdapter adapter;

    @ViewById
    ListView petlistview;

    @AfterViews
    public void init()
    {
        try
        {
            adapter = new PetInfoListViewAdapter(this);
            adapter.findAll();
            petlistview.setAdapter(adapter);
            petlistview.setOverScrollMode(View.OVER_SCROLL_NEVER);
        }
        catch (Exception e)
        {
            Log.e("异常1510221149",e.toString());
        }
    }

    @Click
    public void home()
    {
        finish();
    }
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK)
        {
            home();
        }
        return true;
    }
}
